<script>
  if (/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
    window.location.href = (window.location.origin + '/mobile' + window.location.pathname);
  }
</script>